package com.bawei.detail.api

import com.bawei.network.HttpInterceptorType
import com.bawei.network.HttpManager
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module //声明为Hilt模块
@InstallIn(SingletonComponent::class) //声明当前模块可以在应用内注入对象
object DetailServerModule {

    @Provides //提供统一实现
    @Singleton //声明为单例
    fun getDetailServerApi(): DetailServerApi{
        return HttpManager.createApiServer(DetailServerApi::class.java, HttpInterceptorType.TOKEN)
    }

}